<?php
namespace model;
use \model\model_m;
//角色模型
class role_m{
	public function __construct(){
		$this->table='role';
	}
	public function s_one($where,$field="*"){
		return M($this->table)->where($where)->select_one($field);
	}
  public function s_all($where=array(),$field='*'){
			return M($this->table)->where($where)->select_all($field);
  }
	//添加角色
	public function a_one($data){
		return M($this->table)->insert_one($data);
	}
	//编辑角色
	public function e_one($where,$data){
		return M($this->table)->where($where)->update_one($data);
	}
	//删除角色
	public function d_one($where){
		return M($this->table)->where($where)->delete_one();
	}
}
?>
